import { ActionTree } from 'vuex';
import { States } from './states';
import { getNavContent, getRouterMap } from '@/api/global';

const actions: ActionTree<States, any> = {
    // 将导航栏目录数据存入vuex
    loadNavBar({ commit }) {
        getNavContent().then(content => {
            commit('setNavContent', content);
        });
    },

    //将路由表存入vuex
    loadRouterMap({ commit }) {
        getRouterMap().then(data => {
            commit('setRouterMap', data);
        });
    },
};
export default actions;
